#ifndef _C_GL_PROGRAM_H_
#define _C_GL_PROGRAM_H_

#include "..\glew\glew.h"
#include "..\cuCommon\cuTypes.h"

class CglProgram
{
public:
    CglProgram(void);
    ~CglProgram(void);

    bool Create(GLhandleARB vs, GLhandleARB ps);
    bool Create(GLhandleARB vs, GLhandleARB gs, GLhandleARB ps);
    void Delete(void);

    void Enable(void);
    void Disable(void);

    GLhandleARB Id() { return m_ID; }

    GLhandleARB m_ID;

    int8 m_Log[1024];
    int32 m_LogLength;

    void setUniform1f(const GLchar *name, GLfloat x);
    void setUniform2f(const GLchar *name, GLfloat x, GLfloat y);
    void setUniform3f(const GLchar *name, GLfloat x, GLfloat y, GLfloat z);
    void setUniform4f(const GLchar *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
    void setUniformfv(const GLchar *name, GLfloat *v, int elementSize, int count=1);
    void setUniformMatrix4fv(const GLchar *name, GLfloat *m, bool transpose);

    void bindTexture(const GLchar *name, GLuint tex, GLenum target, GLint unit);
};

#endif // _C_GL_PROGRAM_H_